<?php
class RegisterForm extends CFormModel {
	public $username;
	public $password;
	public function rules()
	{
		return array(
				array('username, password', 'required'),
		);
	}

	public function attributeLabels()
	{
		return array(
				'username'=>Yii::t('user','username'),
				'password'=>Yii::t('user','password')
		);
	}
	
	
	
	public function register(){
		$user = new User();
		$user->username = $this->username;
		$user->password = md5($this->password);
		$user->lastlogin = date('Y-m-d H:i:s');
		if($user->save()){
			
		}else{
		}
	}
}

?>